Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!feat: Add invartiants #101

Merged
merged 41 commits into from
Jan 25, 2024
Merged

!feat: Add invartiants #101

merged 41 commits into from
Jan 25, 2024

Conversation

GNaD13
Copy link
Collaborator

@GNaD13 GNaD13 commented Jan 14, 2024

This PR should be merge after #111

@neitdung neitdung changed the title Add invartiants !feat: Add invartiants Jan 16, 2024
x/multi-staking/keeper/abci.go Outdated Show resolved Hide resolved
x/multi-staking/module.go Outdated Show resolved Hide resolved
x/multi-staking/keeper/invariants.go Outdated Show resolved Hide resolved
@catShaark
Copy link
Collaborator

Can you add some tests

@GNaD13
Copy link
Collaborator Author

GNaD13 commented Jan 25, 2024

@catShaark could you check this pr pls?

_, err = suite.msgServer.CreateValidator(suite.ctx, &msg)
suite.Require().NoError(err)

tc.malleate()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there's no fail case in this test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invariants should be success in any case

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be fail case in test, just set data in the store that causes it to fail

name string
malleate func()
expError bool
}{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no fail case for this test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different test for check the store, not related in invariants. We should continue this test in different PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be fail case anyway because there is tc.expError.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so I think we should move it to a separate PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay to put the test in this pr

@catShaark catShaark merged commit a8d8a36 into main Jan 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants